<template>
	<view class="content">
		登录界面
		<table>
			<tr>
				<td>用户名</td>
				<td><input type="text" v-model="username" style="background-color: antiquewhite;"></td>
			</tr>
			
			<tr>
				<td>密码</td>
				<td><input type="password" v-model="password" style="background-color: antiquewhite;"></td>
			</tr>
		</table>
		<view style="display: flex;">
			<button @click="resister()">注册</button>
			<button @click="login()">登录</button>
		</view>

		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username : "",
				password : "",
			}
		},
		methods: {
			login(){
				uni.request({
				    url: 'http://127.0.0.1:8080/login', //仅为示例，并非真实接口地址。
				    data: {
				      username : this.username,
				      password : this.password,
				    },
					method:"post",
				    header: {
				        'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
				    },
				    success: (res) => {
				        console.log(res.data)
				        
				    }
				});
			},
			resister(){
				uni.navigateTo({
					url:"/pages/resister/resister"
				})
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
